package actions;

import game.constants.ReferenceAction;
import game.constants.ReferenceSpecialFeature;
import interfaces.ActionInterface;
import interfaces.impl.Action;
import objects.SpetialFeature;
import universe.Universe;


public class ActionGiveVespeneGas extends Action{
	
	double quantity=0;

	@Override
	public ActionInterface cloneAction() {
		ActionGiveVespeneGas action = new ActionGiveVespeneGas();
		action.modifyAction(this);
		return action;
	}

	@Override
	public boolean processActionChild(Universe universe) {
		SpetialFeature vespeneGas = target.getFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VESPENE_GAS_QUANTITY);
		vespeneGas.setValue(vespeneGas.getValue()-quantity);
		
		return true;
	}

	@Override
	public void initializeName() {
		name="Action Give Vespene Gas";
		
	}

	@Override
	public void initializeId() {
		id= ReferenceAction.ACTION_GIVE_VESPENE_GAS;
		
	}

	@Override
	public void modifyChild(ActionInterface action) {
		if (action instanceof ActionGiveVespeneGas){
			quantity=((ActionGiveVespeneGas) action).quantity;
		}
		
	}

	public double getQuantity() {
		return quantity;
	}

	public void setQuantity(double quantity) {
		this.quantity = quantity;
	}

	
	
}
